
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Grebok.Common;
using Grebok.Common.Configuration;

namespace EVegetable.Persistence.Test.DataManager
{
    public class TSys_PreferenceManager : BaseManager
    {
        #region private field

        private static TSys_PreferenceManager manager;
        #endregion

        #region Properties
        
        public Int32 PreferenceID
        {
            get { return GetConfig<Int32>("PreferenceID"); }
            set { SetConfig<Int32>("PreferenceID", value); }
        }
        
        public String PreferenceCode
        {
            get { return GetConfig<String>("PreferenceCode"); }
            set { SetConfig<String>("PreferenceCode", value); }
        }
        
        public String PreferenceValue
        {
            get { return GetConfig<String>("PreferenceValue"); }
            set { SetConfig<String>("PreferenceValue", value); }
        }
        
        public Int32 UserID
        {
            get { return GetConfig<Int32>("UserID"); }
            set { SetConfig<Int32>("UserID", value); }
        }
        
        public String Description
        {
            get { return GetConfig<String>("Description"); }
            set { SetConfig<String>("Description", value); }
        }
        
        public Int32? Creator
        {
            get { return GetConfig<Int32?>("Creator"); }
            set { SetConfig<Int32?>("Creator", value); }
        }
        
        public DateTime? CreatedDate
        {
            get { return GetConfig<DateTime?>("CreatedDate"); }
            set { SetConfig<DateTime?>("CreatedDate", value); }
        }
        
        public Int32? Modifier
        {
            get { return GetConfig<Int32?>("Modifier"); }
            set { SetConfig<Int32?>("Modifier", value); }
        }
        
        public DateTime? ModifiedDate
        {
            get { return GetConfig<DateTime?>("ModifiedDate"); }
            set { SetConfig<DateTime?>("ModifiedDate", value); }
        }
        

        #endregion

        #region Constructor

        /// <summary>
        /// TSys_PreferenceManager
        /// </summary>
        private TSys_PreferenceManager()
        {
            IApplicationConfiguration configuration = ApplicationConfigurationFactor.CreateApplicationConfiguration();
            appPropertiese = new ApplicationProperties(configuration[PropertiesConst.TSYS_PREFERENCE_PROPERTIES_FILE_NAME_KEY],
                configuration[PropertiesConst.TSYS_PREFERENCE_PROPERTIES_SECTION_NAME_KEY]);

            appPropertieseValues = new Dictionary<string, object>();
        }
        #endregion

        #region TSys_PreferenceManager Instance

        /// <summary>
        /// TSys_PreferenceManager's Instance
        /// </summary>
        public static TSys_PreferenceManager Instance
        {
            get
            {
                if (manager == null)
                {
                    manager = new TSys_PreferenceManager();
                }
                return manager;
            }
        }
        #endregion

    }
}
